{extend name='public/content'}

{block name="title"}
	保存用户信息
{/block}

{block name="body"}
<form  action="" class='layui-form' method="post">
	    <div class="layui-form-item">
		    <label class="layui-form-label">姓名</label>
		    <div class="layui-input-block">
		      <input type="text" name="consignee" value="" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">电话</label>
		    <div class="layui-input-block">
		      <input type="text" name="mobile" value="" required phone  lay-verify="required|phone" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">邮箱</label>
		    <div class="layui-input-block">
		      <input type="text" name="email" value="" required  lay-verify="email" placeholder="请输入 邮箱" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">国籍</label>
		    <div class="layui-input-block">
		      <input type="text" name="country" value="" required  lay-verify="required" placeholder="请输入国籍" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">邮编</label>
		    <div class="layui-input-block">
		      <input type="text" name="zipcode" value="" required  lay-verify="required" placeholder="请输入邮编" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">是否默认</label>
		    <div class="layui-input-block">
		      <input type="checkbox" name="is_default" value="1"   lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">乡镇</label>
		    <div class="layui-input-block">
		      <input type="text" name="twon" value="" required  lay-verify="required" placeholder="乡镇" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	    <div class="layui-form-item">
		    <label class="layui-form-label">详细地址</label>
		    <div class="layui-input-block">
		      <input type="text" name="address" value="" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
		    </div>
	    </div>
	   <input type="hidden" name="province1">
	   <input type="hidden" name="city1">
	   <input type="hidden" name="area1">


	
		<button lay-submit style="display: none" id="subint"></button>
	 
</form>

   <div class="layui-form-item" id="sanjilaingdong">
			<div class="citys">
				    <div class="layui-input-inline">
				        <select class="layui-select" name="province"></select>
				    </div>
				    <div class="layui-input-inline">
				        <select class="layui-select" name="city"></select>
				    </div>
				    <div class="layui-input-inline">
				        <select class="layui-select" name="area"></select>
				    </div>
			</div>
	</div>	

	<button lay-submit id="baocun">添加地址</button>

{/block}

{block name="script"}
 	<script type="text/javascript">
 		require(['jquery','pcasunzips'], function () {
 			var baocun;
 			$("#baocun").click(function(){
 				let pro = $("select[name=province] option:selected").val()
 				let city = $("select[name=city] option:selected").val()
 				let area = $("select[name=area] option:selected").val()
	 		    $("input[name=province]").val(pro);
	 		    $("input[name=province]").val(city);
	 		    $("input[name=province]").val(area);
 				//alert($("#yingchag"));
 				//console.log($("#sanjilaingdong").text());
 				// $("#yingchag").text($("#sanjilaingdong")[0].innerHTML);return;
 				$("#subint").click();
 			})
	    /**   // 省市联动
	    *   new PCAS("Province","City")
	    *   new PCAS("Province","City","吉林省")
	    *   new PCAS("Province","City","吉林省","吉林市")
	    *   // 省市地区联动
	    *   new PCAS("Province","City","Area")
	    *   new PCAS("Province","City","Area","吉林省")
	    *   new PCAS("Province","City","Area","吉林省","松原市")
	    *   new PCAS("Province","City","Area","吉林省","松原市","宁江区")
	    *   // 省、市、地区对象取得的值均为实际值。
	    *   // 注：省、市、地区提示信息选项的值为""(空字符串)
	    */
	    // 实例化PCAS插件
	    new PCAS('province', 'city', 'area', '广东省', '广州市', '海珠区');
	});
 	</script>
{/block}

{block name="style"}
 <style type="text/css">
 	
 </style>
{/block}